import axios from '@/utils/request'

/**
 * 获取所有频道列表
 * @returns
 */
export const getChannelListAPI = () => {
  return axios({
    url: '/v1_0/channels'
  })
}

/**
   * 获取用户频道列表
   * @returns
   */
export const getUserArticleList = () => axios({
  url: '/v1_0/user/channels'
})

/**
   * 重置用户频道
   * @param {*} channels
   * @returns
   */
export const setChannelListAPI = (channels) => axios({
  url: '/v1_0/user/channels',
  method: 'PUT',
  data: {
    channels: channels
  }
})

/**
   * 删除用户所选频道
   * @param {*} channelId
   * @returns
   */
export const delChannelAPI = (channelId) => axios({
  url: '/v1_0/user/channels/' + channelId,
  method: 'DELETE'
})
